<template>
  <el-dialog
    title="考试人员列表"
    :close-on-click-modal="false"
    :visible.sync="visible"
    lock-scroll
    width="70%"
    append-to-body
  >
    <!-- <JADP-table :data="list" height="500px">
      <el-table-column prop="clazzid" label="班级名称" align="left" />
      <el-table-column prop="stuid" label="学生姓名" align="left" />
      <el-table-column prop="paperid" label="试卷名称" align="left" />
      <el-table-column prop="starttime" label="考试开始时间" align="left" />
      <el-table-column prop="endtime" label="考试结束时间" align="left" />
      <el-table-column prop="bkstatus" label="补考状态" align="left">
        <template v-slot="{ row }">
          {{ row.bkstatus ? "已完成补考" : "未完成补考" }}
        </template>
      </el-table-column>
    </JADP-table> -->
    <el-table :data="list" height="500px" row-key="id" border>
      <el-table-column type="index" label="序号" width="50"> </el-table-column>
      <el-table-column label="班级" prop="clazzname"></el-table-column>
      <el-table-column label="姓名" prop="name"></el-table-column>
      <el-table-column label="单位" prop="company"></el-table-column>
      <el-table-column label="班级设定学时" prop="hours"></el-table-column>
      <el-table-column label="考生已完成学时" prop="comhours"></el-table-column>
    </el-table>
    <pagination
      :total="total"
      :page.sync="listQuery.currentPage"
      :limit.sync="listQuery.pageSize"
      @pagination="init"
    />
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="visible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
import request from "@/utils/request";
export default {
  name: "bukaoform",
  data() {
    return {
      visible: false,
      query: {},
      total: 0,
      listQuery: {
        currentPage: 1,
        pageSize: 20,
        sort: "desc",
        sidx: "creatortime"
      },
      list: [],
      cpid: "",
      clazzid: ""
    };
  },
  methods: {
    init() {
      this.visible = true;
      let _query = {
        ...this.listQuery,
        ...this.query,
        cpid: this.cpid,
        clazzid: this.clazzid,
        organizeId:this.$store.getters.organizeId
      };
      let query = {};
      for (let key in _query) {
        if (Array.isArray(_query[key])) {
          query[key] = _query[key].join();
        } else {
          query[key] = _query[key];
        }
      }
      // request({
      //   url: "/api/xy_ks_supplement_exam/Xy_ks_supplement_exam",
      //   method: "get",
      //   data: query
      // }).then(res => {
      //   this.list = res.data.list;
      //   this.total = res.data.pagination.total;
      // });
      request({
        url: "/api/select_stu/Xy_ks_select_stu",
        method: "get",
        data: query
      }).then(res => {
        console.log(res);
        this.list = res.data.list;
        this.total = res.data.pagination.total;
      });
    }
  }
};
</script>
<style scoped lang="scss">
>>> .el-dialog {
  margin-top: 10vh !important;
}

>>> .el-dialog__header {
  border-bottom: 1px solid #ccc;
}

// >>> .el-dialog__body {
//   padding: 10px;
// }
</style>
